package com.example.hello.service.impl;

import com.example.hello.entity.Permission;
import com.example.hello.mapper.PermissionMapper;
import com.example.hello.service.PermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2022-07-22
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {

    @Override
    public Set<String> getPermissionsByRole(String roleName) {
        return baseMapper.getPermissionsByRole(roleName).stream().collect(Collectors.toSet());
    }
}
